import requests
import time


def download_to_file_path(file_path, url):
    status_code = 0
    count = 0
    r = None
    while status_code != 200 and count < 5:
        r = requests.get(url, timeout=5)
        status_code = r.status_code
        count += 1
        if status_code != 200:
            time.sleep(1)
    if status_code == 200:
        with open(file_path, "wb") as f:
            f.write(r.content)
        return True
    return False

